import React from "react"
import styles from "./SmallCard.css"

export default class SmallCard extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            style:styles.box
        }
    }
    render() {
        return (
            <div onClick={() => this.handleCardClick()} className={this.state.style}>
                <div>
                    <img width='100%' src={"/img/tj/资源 " + (89+this.props.type) + "@2x.png"} alt=""/>
                </div>
                <div>
                    <img width='100%' src={"/img/tj/资源 " + (89+this.props.type) + "@2x.png"} alt=""/>
                </div>
            </div>
        );
    }
    handleCardClick = () => {
        this.setState({
            style:styles.flip
        })
    }
}